package com.example.demo.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by chenbo on 2018/5/25.
 */
@Aspect
@Component
public class HttpAspect {

    @Pointcut("execution(public * com.example.demo.controller.HelloController.*(..))")
    public void log(){

    }

    @Before ( "log()" )
    public void before(){
        System.out.println ( "request：" );
    }

    @After ( "log()" )
    public void after(){
        System.out.println ( "response:" );
    }
}
